﻿using System.Collections.Immutable;
using System.Collections.ObjectModel;
using System.Reflection;
using System.Serialization;

namespace PerpheralDevice;

/// <summary>
/// 外部设备配置
/// </summary>
public class PerpDevConfig : IPerpDevConfig {

    /// <summary>
    /// 外设ID
    /// </summary>
    public string DevID { get; set; }
    /// <summary>
    /// 外设名称
    /// </summary>
    public string? DevName { get; set; }
    /// <summary>
    /// 外设标签
    /// </summary>
    public string? TagName { get; set; }
    /// <summary>
    /// 外设描述
    /// </summary>
    public string? DevDesc { get; set; }
    /// <summary>
    /// 外设序号
    /// </summary>
    public int DevIndex { get; set; }
    /// <summary>
    /// 外设对象类型
    /// </summary>
    public string DevType { get; set; }
    /// <summary>
    /// 外设相关参数(序列化值，默认为yaml)
    /// </summary>
    public string? DevParamSerialized { get; set; }

}

/// <summary>
/// 外部设备配置
/// </summary>
public interface IPerpDevConfig {
    /// <summary>
    /// 外设ID
    /// </summary>
    string DevID { get; }
    /// <summary>
    /// 外设名称
    /// </summary>
    string? DevName { get; }
    /// <summary>
    /// 外设标签
    /// </summary>
    string? TagName { get; }
    /// <summary>
    /// 外设描述
    /// </summary>
    string? DevDesc { get; }
    /// <summary>
    /// 外设序号
    /// </summary>
    int DevIndex { get; }
    /// <summary>
    /// 外设服务类型
    /// </summary>
    string DevType { get; }
    /// <summary>
    /// 外设相关参数(序列化值，默认为yaml)
    /// </summary>
    string? DevParamSerialized { get; }
}
